package com.nacrtstudio.webgiftshop.pages.admin;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.nacrtstudio.webgiftshop.facade.Controller;
import com.nacrtstudio.webgiftshop.model.shop.Category;

@RequiresRoles("admin")
public class EditCategory {
	@Inject
	private Controller controller;
	@Persist
	private Category category;
	public Category getCategory() {
		return category;
	}
	public void setCategory(Category category) {
		this.category = category;
	}
	
	Object onSuccess(){
		controller.updateCategory(category);
		return AllCategories.class;
	}
}
